<template>
	<view class="main">
		<view class="line"></view>
		<view class="img">
			<image class="index-img" src="../../static/images/index/index_01.png" mode=""></image>
			<view class="zhihui">智慧社区</view>
			<view class="sousuo">
				<view class="dingwei">
					<image class="de-img" src="../../static/images/index/首尔甜城.jpg" mode=""></image>
					<view class="tiancheng">首尔甜城</view>
				</view>
				
				<view class="sskuang">
					<image class="ssk-img" src="../../static/images/index/搜索.jpg" mode=""></image>
					<view class="guangjianzi">搜索关键字</view>
				</view>
			</view>
			<view class="daohang">
				<view class="shenghuo">
					<view class="shjiaof">
						<image class="shjf" src="../../static/images/index/首页_03.jpg" mode=""></image>
						<view class="jf">生活缴费</view>
					</view>
					<view class="shjiaof" @tap="baoxiu">
						<image class="shjf" src="../../static/images/index/物业报修.jpg" mode=""></image>
						<view class="jf">物业保修</view>
					</view>
					<view class="shjiaof">
						<image class="shjf" src="../../static/images/index/问题反馈.jpg" mode=""></image>
						<view class="jf">问题反馈</view>
					</view>
					<view class="shjiaof">
						<image class="shjf" src="../../static/images/index/帮助.jpg" mode=""></image>
						<view class="jf">我要帮助</view>
					</view>
				</view>
			</view>
		</view>
		<view class="bottom">
			<!-- 新闻 -->
			<view class="toutiao">
				<view class="tout">
					<view class="guanyu">
						<image class="ttiao-img" src="../../static/images/index/首页_09_03.jpg" mode=""></image>
						<!-- 头条轮播图 -->
						<swiper style="display: flex;" class="womeng" autoplay vertical interval="800" circular >
							<swiper-item v-for='(item,index) in usernewslists' :key='index'>
								<view>{{item.title}}</view>
							</swiper-item>	
						</swiper>
					</view>
					<view class="gengduodian">
						<image class="dian-img" src="../../static/images/index/m_26.jpg" mode=""></image>
						<view class="gengduo" @click="zixunxiangqin">更多</view>
						<image class="you-img" src="../../static/images/index/右.png" mode=""></image>
					</view>
				</view>
				<view class="lbt">
					<!-- 图片轮播图 -->
					<swiper style="display: flex;" class="lbt-img" autoplay  interval="1000" circular >
						<swiper-item v-for='(item,index) in usernewslists' :key='index'>
							<image class="tplb" :src="qweurl+item.picture" mode=""></image>
						</swiper-item>	
					</swiper>
				</view>
			</view>
			<!-- 生活门店 -->
			<view class="shmd">
				<view class="shenhuo">生活门店</view>
				<view class="jfms">
					<view class="jiaof">
						<image class="jf-img" src="../../static/images/index/首页_15.jpg" mode=""></image>
					</view>
					<view class="miaos">
						<image class="ms-img" src="../../static/images/index/首页_10_03.jpg" mode=""></image>
					</view>
				</view>
			</view>
			
			<!-- 资讯 -->
			<view class="zixunlibiao">
				<view class="zixun">资讯</view>
				<!-- 1 -->
				<view class="zxlbiao" v-for='(item,index) in usernewslists' :key='index' @click="xiangqing">
					<view class="liebiao-left">
						<view class="atmji">{{item.title}}</view>
						<view class="shijian">{{item.addtime}}</view>
					</view>
					<view class="tupian-right">
						<image class="tp-img" :src="url+item.picture" mode=""></image>
						<!-- <image class="tp-img" src="../../static/images/index/首页_11_03.jpg" mode=""></image> -->
					</view>
				</view>
				
			</view>
			
		</view>
	</view>
</template>
<script>
	import Index from '../../apis/index.js'
	export default{
		data(){
			return{
				url:'http://estate.eshareedu.cn/estate/upload/',
				usernewslists:[],
				qweurl:'http://estate.eshareedu.cn/estate/upload/'
			}
		},
		created(){
			this.womeng()
		},
		methods:{
			baoxiu(){
				uni.navigateTo({
					url:'/pages/index/Repair-Application/Repair-Application'
				})
			},
			xiangqing(){
				uni.navigateTo({
					url:'/pages/index/detailed/detailed'
				})
			},
			async womeng(){
				let res =await Index.newslist()
				console.log(res);
				if(res.errCode==10000){
					this.usernewslists=res.data.list
				}else{
					this.$message.error(res.errMsg)
				}
			},
			zixunxiangqin(){
				uni.navigateTo({
					url:'/pages/index/RealTime/RealTime'
				})
			}
		}
	}
</script>
<style lang="less">
@import url('../../static/css/index/index.css');
</style>